extends Card


func play_on_release(card_view: CardView) -> void:
	var player = card_view.get_tree().get_first_node_in_group("player")
	player.play_animation("attack")

	CardManager.round_data.anger_addition_times += self.anger_addition_times + 1
	CardManager.round_data.anger_addition_card.push_back(self)

	var player_state: PlayerInBattleState = Globals.player_state
	player_state.anger_addition = self.anger_addition_times

	var tween := card_view.create_tween()
	tween.tween_interval(0.21)
	await tween.finished
	player.play_animation("default")
	card_view.play_on_release_signal_finish.emit()


func play_on_release_after(_card_view: CardView):
	if CardManager.round_data.anger_addition_times > 0:
		CardManager.round_data.anger_addition_times -= 1


func get_desc() -> String:
	if desc_lab == "":
		return ""
	var text = (
		desc_lab
		% [
			self.anger_addition_times,
			self.consume_anger,
			self.anger_addition,
			self.max_consume_anger
		]
	)
	return text


func init_from_csv(introduce):
	super.init_from_csv(introduce)
	self.anger_addition_times = int(introduce[5])
	self.consume_anger = int(introduce[6])
	self.anger_addition = int(introduce[7])
	self.max_consume_anger = int(introduce[8])
